import { hasPermission } from '@/utils/tools'
export const userList = {
  data: [],
  columns: [
    {
      label: '用户名',
      prop: 'username'
    },
    {
      label: '手机号',
      prop: 'phone'
    },
    {
      label: '角色',
      prop: 'roleId',
      type: 'select',
      selectData: [],
      disabled: () => !hasPermission('user_list_edit')
    },
    {
      label: '创建时间',
      prop: 'addTime'
    },
    {
      label: '启用状态',
      prop: 'disabled',
      type: 'switch',
      switchValues: [0, 1],
      disabled: () => !hasPermission('user_list_edit')
    }

  ],
  pages: {
    page: 1,
    size: 10,
    total: 0
  },
  operatingWidth: '240',
  operating: [
    {
      label: '编辑',
      show: () => hasPermission('user_list_edit'),
      name: 'edit'
    },
    {
      label: '删除',
      show: () => hasPermission('user_list_del'),
      name: 'del'
    }
  ]
}

export const userLogTable = {
  data: [],
  columns: [
    {
      label: '用户账号',
      prop: 'userId',
      width: 160
    },
    {
      label: '用户手机',
      prop: 'createTime',
      width: 160
    },
    {
      label: '登录时间',
      prop: 'username'
    },
    {
      label: '操作记录',
      prop: 'mobile'
    }
  ],
  pages: {
    page: 1,
    size: 10,
    total: 0
  }
}
export const collectionLogTable = {
  data: [],
  columns: [
    {
      label: '时间',
      prop: 'userId',
      width: 160
    },
    {
      label: '集群',
      prop: 'createTime',
      width: 160
    },
    {
      label: '云服务器',
      prop: 'username'
    },
    {
      label: '运行数量',
      prop: 'mobile'
    },
    {
      label: '停止数量',
      prop: 'mobile'
    }
  ],
  pages: {
    page: 1,
    size: 10,
    total: 0
  }
}

export const roleList = {
  data: [{ name: '1', code: '2' }],
  columns: [
    {
      label: '角色名称',
      prop: 'name'
    },
    {
      label: '角色编码',
      prop: 'code'
    },
    {
      label: '角色描述',
      prop: 'description'
    },
    {
      label: '创建时间',
      prop: 'addTime'
    }
  ],
  pages: {
    page: 1,
    size: 10,
    total: 0
  },
  operating: [
    {
      name: 'authority',
      type: 'warning',
      label: '权限管理',
      show: () => hasPermission('user_character_auth')

    },
    {
      name: 'member',
      type: 'warning',
      label: '成员管理',
      show: () => hasPermission('user_character_user')

    },
    {
      name: 'edit',
      type: 'primary',
      label: '编辑',
      show: () => hasPermission('user_character_edit')

    },
    {
      name: 'del',
      type: 'danger',
      label: '删除',
      show: () => hasPermission('user_character_del')

    }
  ],
  operatingWidth: 300
}

